# uncompyle6 version 3.2.3
# Python bytecode 3.6 (3379)
# Decompiled from: Python 3.6.8 |Anaconda custom (64-bit)| (default, Feb 21 2019, 18:30:04) [MSC v.1916 64 bit (AMD64)]
# Embedded file name: helpers\hashing\password.py
__author__ = "Attila Gerendi (Sanyi)"
from helpers.hashing import sha256


def strategy_ovs1_compatibility(value, salt=None):
    """
    This strategy should help migrating old ovs users
    assumes that password is already sha256 client side
    :param value:
    :param salt:
    :return:
    """
    password_hash = value
    for i in range(0, 100):
        password_hash = sha256(password_hash + sha256(password_hash))

    if salt:
        password_hash = sha256(password_hash, salt)
    return password_hash


def strategy_direct(value, salt=None):
    return value


def strategy_one_hash_salted(value, salt):
    return sha256(value, salt)
